﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ZHDJ.WebPage;
using ZHDJ.Data.Models.Org;
using ZHDJ.WebPage.Master;
using ZHDJ.Data.BLL;

namespace ZHDJ.Web.Portal.BranchHome
{
    public partial class BranchDutyPage : UseMorePageMasterPage
    {
        /// <summary>
        /// BranchID
        /// </summary>
        private string BranchID
        {
            get
            {
                return this.Request["BranchID"] ?? "null";
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoadData();
            }
        }

        public void LoadData()
        {
            if (string.IsNullOrWhiteSpace(this.BranchID))
            {
                RedirectTo("default", "~/default.aspx");
                return;
            }
            var model = DB.PartyOrgDutys.Where(i => i.BranchID == this.BranchID).FirstOrDefault();
            if (model != null)
                litContent.Text = model.Content;
        }

        /// <summary>
        /// 初始化module  如果通过url传参可不设置
        /// </summary>
        protected override void InitModule()
        {
            Module = "BranchHomeMore";
            Category = "BranchDutyPage";
        }
    }
}